//
//  HEHealthCheckRecodCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/12/21.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEHealthCheckRecodCell.h"

@interface HEHealthCheckRecodCell ()

@property (nonatomic, strong) UILabel *titleLb;
@property (nonatomic, strong) UILabel *valueLb;

@end

@implementation HEHealthCheckRecodCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.qmui_borderPosition = QMUIViewBorderPositionBottom;
        self.qmui_borderWidth = 1;
        self.qmui_borderColor = CSplitLineColor;
        [self initUI];
    }
    return self;
}

- (void)initUI {
    
    _titleLb = [UILabel new];
    _titleLb.text = @"-";
    _titleLb.font = DYFont(17);
    _titleLb.textColor = CNavLightBlackColor;
    _titleLb.numberOfLines = 0;
    [self.contentView addSubview:_titleLb];
     
    _valueLb = [[UILabel alloc] init];
    _valueLb.text = @"-";
    _valueLb.font = DYBlodFont(18);
    _valueLb.textColor = CNavDargGrayColor;
    _valueLb.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:_valueLb];
    
    [_titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(_valueLb);
        make.left.equalTo(self.contentView.mas_left).mas_offset(10);
    }];
 
    [_valueLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).mas_offset(15);
        make.left.equalTo(_titleLb.mas_right).mas_offset(10);
        make.right.equalTo(self.contentView).mas_offset(-10);
        make.bottom.equalTo(self.contentView).mas_offset(-15);
    }];
}

- (void)setModel:(HEDataManageModel *)model {
    _model = model;
    
    _titleLb.text = [NSDate timestampToDate:model.create_date formaterMode:NSDateFormaterModeDay];
    _valueLb.text = model.KValue;
    _valueLb.textColor = model.KValueColor;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
